package com.atguigu.spzx.feign.product.fallback;

import com.atguigu.spzx.feign.product.ProductFeignClient;
import com.atguigu.spzx.model.entity.order.OrderItem;
import com.atguigu.spzx.model.entity.product.ProductSku;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;

@Slf4j
@Component
public class ProductFeignClientFallback implements ProductFeignClient {

//    @Override
//    public Result<ProductSku> getBySkuId(Long skuId) {
//        log.info("ProductFeignClientFallback...getBySkuId的方法执行了");
//        return Result.build(null , ResultCodeEnum.SUCCESS) ;
//    }

    @Override
    public Result findSkuBySkuId(Long skuId) {
        log.error("远程访问product服务查询sku数据失败，skuid={}",skuId);
        return Result.build(null,ResultCodeEnum.UNKNOW_ERROR );
    }

    @Override
    public Result<List<ProductSku>> findProductSkus(List<OrderItem> orderItemList) {
        log.error("远程访问product服务查询订单项的商品列表数据失败");
        return Result.build(null,ResultCodeEnum.UNKNOW_ERROR );
    }
}